
<meta charset="utf-8" />	
<form class="form-horizontal" role="form"  onsubmit="return submitForm(this);"
 action="mpcoop/coopAdd/add.do" >
 <br/>
	<!-- 
	 * Input属性说明:
	 * validate="true"  是否需要验证字段
	 * msg="错误时提示信息"        
	 * datatype="数据类型"
	-->
	<!-- #section:elements.form -->
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 合作机构编号： </label>
		<div class="col-sm-9">

			<input type="text" id="cooporgNo" name="cooporgNo" placeholder="请输入[合作机构编号]" 
				class="col-xs-10 col-sm-7" validate="true"  maxlength="30" />
		</div>
		
	</div>
	
	<div class="form-group">
	    <label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 合作机构名称： </label>
		<div class="col-sm-9">

			<input type="text" id="coopname" name="coopname" placeholder="请输入[合作机构名称]" 
				class="col-xs-10 col-sm-7" validate="true" datatype="chinese" maxlength="40"/>
		</div>
	</div>
	
	<div class="form-group">  
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 合作机构简称： </label>
		<div class="col-sm-4">

			<input type="text" id="coopAbb" name="coopAbb" placeholder="请输入[合作机构简称]" 
				class="col-xs-10 col-sm-7" validate="true"/>
		</div>
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> MCC： </label>
		<div class="col-sm-4">

			<input type="text" id="mcc" name="mcc" placeholder="请输入[MCC]" 
				class="col-xs-10 col-sm-7"  validate="true"/>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 合作机构地区码： </label>
		<div class="col-sm-4">

			<input type="text" id="areacd" name="areacd" placeholder="请输入[合作机构地区码]" 
				class="col-xs-10 col-sm-7"  />
		</div>
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 合作机构类型： </label>
		<div class="col-sm-4">
			<select 
					rel="obj.COOPTYPE"
					location="local" 
					name="coopType" 
					id="coopType" 
					data-placeholder="请选择类型" style="width: 120px;vertical-align:middle;">
					<option value='' >--请选择--</option>
			</select>
		</div>
		
	</div>
	
	<div class="form-group">
	   <label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 服务开通状态： </label>
		<div class="col-sm-4">
           <select 
					rel="obj.SVRSTS"
					location="local" 
					name="svrsts" 
					id="svrsts" 
					data-placeholder="请选择状态" style="width: 120px;vertical-align:middle;">
					<option value='' >--请选择--</option>
			</select>
		</div>
	   <label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 联系人： </label>
		<div class="col-sm-4">

			<input type="text" id="contact" name="contact" placeholder="请输入[联系人]" 
				class="col-xs-10 col-sm-7"  />
		</div>
		
		
	</div>
	
	<div class="form-group">  
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 联系电话： </label>
		<div class="col-sm-4">

			<input type="text" id="phone" name="phone" placeholder="请输入[联系电话]" 
				class="col-xs-10 col-sm-7" validate="true" datatype="mobile"/>
		</div>
		<!-- 默认系统时间
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 编辑时间： </label>
		<div class="col-sm-4">
			<input type="text" id="editDate" name="editDate" placeholder="请输入[编辑时间]" 
				class="col-xs-10 col-sm-7"  />
		</div> -->
		<label class="col-sm-2 control-label no-padding-right"
			for="form-field-1"> 编辑员： </label>
		<div class="col-sm-4">

			<input type="text" id="editUserName" name="editUserName" placeholder="请输入[编辑员]" 
				class="col-xs-10 col-sm-7"  />
		</div>
	</div>
	<input type="hidden" id="editUserId" name="editUserId" />
	
	<div class="form-group">
	    
		
	</div>
	
	<div class="form-actions align-right  form-button-box" style="margin-top: 10px">
			<button class="btn btn-info" type="submit">
				保存
			</button>

			&nbsp; 
			<button class="btn" type="button" onclick="javascript:dialog.close(this);">
				 关闭
			</button>
		</div>
	
</form>
<script type="text/javascript">
<!--

//-->

$(document).ready(function() {
	 var p = dialog.getById('dlg-cooporgadd');
		//设置页面初始值
		$("#editUserId").attr("value",p.dataParam.editUserId);
		$("#editUserName").attr("value",p.dataParam.editUserName);
});

function submitForm(obj){
	
	var coopType=$("#coopType option:selected").val();
	if(coopType==''){
		alertMsg.error('请选择合作机构类型');
		return false;
	}
	
	var svrsts=$("#svrsts option:selected").val();
	if(svrsts==''){
		alertMsg.error('请选择服务开通状态');
		return false;
	}
	
	//自定义匿名回调函数。 系统默认回调函数：dialogAjaxDone
	return validateCallback(obj,function(result){
		if(result.rspcod== 200){
			msg.alert("提示", result.rspmsg, 'correct');
			$("#grid-table").trigger("reloadGrid");
			dialog.close(obj);
		}else{
			msg.alert("错误", result.rspmsg + " 错误代码："
					+ result.rspcod, 'error');
		}
	});
}

</script>
